package com.zhms.mongotest;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.net.InetAddress;

public class RedisClient {


    private JedisPool jedisPool;
    private Jedis jedis;

    public static void main(String[] args) {





//        System.out.println("dadfasdfadsf");
//
//
//        Jedis jedis = new Jedis("127.0.0.1",6379);
//
//        jedis.set("wangyouzhan", "王又展");
//        String value = jedis.get("wangyouzhan");
//        System.out.println(value);
//        jedis.close();




//        try {
//            ConnectionSpec spec = DefaultConnectionSpec.newSpec().setCredentials(password);
//            JRedis	jredis = new JRedisClient(spec);
//            jredis.ping();
//
//            if(!jredis.exists(bkey)) {
//                jredis.set(bkey, "Hello Again!");
//                System.out.format("Hello!  You should run me again!\n");
//            }
//            else {
//                String msg = toStr ( jredis.get(bkey) );
//                System.out.format("%s\n", msg);
//            }
//            jredis.quit();
//        }
//        catch (RedisException e){
//            if (e.getCommand()==Command.PING){
//                System.out.format("I'll need that password!  Try again with password as command line arg for this program.\n");
//            }
//        }
//        catch (ProviderException e){
//            System.out.format("Oh no, an 'un-documented feature':  %s\nKindly report it.", e.getMessage());
//        }
//        catch (ClientRuntimeException e){
//            System.out.format("%s\n", e.getMessage());
//        }



    }



}
